package com.ruyuan.ingestion.kafka.consumer;
import com.ruyuan.ingestion.common.Persistable;
import com.ruyuan.ingestion.parser.hbase.HBaseUserParser;
import com.ruyuan.ingestion.sink.HBaseWriter;

public class UserConsumer extends BaseConsumer {

    @Override
    protected String getKafkaTopic() {
        return "users";
    }

    @Override
    protected Boolean getKafkaAutoCommit() {
        return false;
    }

    @Override
    protected String getKafkaConsumerGrp() {
        return "userConsumer"+getKafkaTopic();
    }

    @Override
    protected int getMaxPollRecords() {
        return 3000;
    }

    @Override
    protected int getMaxPollIntervalMillis() {
        return 5000;
    }

    @Override
    protected Persistable[] getWrites() {
        return new Persistable[]{
                new HBaseWriter("users",new HBaseUserParser())
        };
    }
}
